home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / tcqbsnip.zip / STMPFILE.BAS < prev    next >
BASIC Source File  |  1997-06-20  |  706b  |  27 lines

  1. ' STMPFILE.BAS
  2. ' by Tika Carr
  3. '
  4. ' Donated to the public domain
  5. ' No warranties or guarantees are expressed or implied.
  6. '
  7. ' Purpose: Rename file to a two-letter ID and time/date stamp
  8.  
  9. DECLARE SUB StmpFile (NewKey$, File$)
  10.  
  11. '**** To Use as a command line utility: Parse for two options:
  12. '
  13. 'i = INSTR(COMMAND$, " ")
  14. 'NewKey$ = LEFT$(COMMAND$, i - 1)
  15. 'File$ = RIGHT$(COMMAND$, LEN(COMMAND$) - i - 1)
  16. 'StmpFile NewKey$, File$
  17.  
  18. '**** Use as a subroutine in programs, just use the last line above or:
  19. 'StmpFile "NV", "TEST.DOC"
  20.  
  21. SUB StmpFile (NewKey$, File$)
  22. D$ = DATE$
  23. F$ = LEFT$(NewKey$, 2) + RIGHT$(D$, 2) + LEFT$(D$, 2) + MID$(D$, 4, 2) + RIGHT$(File$, 4)
  24. NAME File$ AS F$
  25. END SUB
  26.  
  27.